﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    private static LuceneHandler luceneHandler = null;

    public _Default()
    {
        if (luceneHandler == null)
        {
            luceneHandler = new LuceneHandler();
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void AgregarDocumentos(object sender, EventArgs e)
    {
        List<Filesystemelements> f1 = new List<Filesystemelements>() {
            new Filesystemelements(){id=1, nombre = "img",extension = "jpg",path = @"D:\Adrian\Fotos\Fotos Gol\img.jpg" },
            new Filesystemelements() { id=2,nombre = "img2", extension = "jpg", path = @"D:\Adrian\Fotos\Fotos Gol\img2.jpg" },
            new Filesystemelements() { id=3,nombre = "img3", extension = "jpg", path = @"D:\Adrian\Fotos\Fotos Gol\img3.jpg" },
            new Filesystemelements() { id=4,nombre = "img4", extension = "jpg", path = @"D:\Adrian\Fotos\Fotos Gol\img4.jpg" },
            new Filesystemelements() { id=5,nombre = "img5", extension = "jpg", path = @"D:\Adrian\Fotos\Fotos Gol\img5.jpg" },
            new Filesystemelements() { id=6,nombre = "img6", extension = "jpg", path = @"D:\Adrian\Fotos\Fotos Gol\img6.jpg" }};
        luceneHandler.AgregarDocumento(f1);
    }


    protected void Buscar(object sender, EventArgs e)
    {
        string input = keyword.Text;
        List<Filesystemelements> lista = luceneHandler.Buscar(input);
        GridView1.DataSource = lista;
        GridView1.DataBind();

    }
}
